package com.dmall.rpc.common;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * 编码器
 * @author xiao1.wang
 * @date 2019-12-25 18:06:05
 */
public class RpcEncoder extends MessageToByteEncoder {

	@Override
	public void encode(ChannelHandlerContext ctx, Object inob, ByteBuf out) {
		//序列化
		out.writeBytes(SerializationUtil.serialize(inob));
	}
}